package c.e.b.h.e.k;

import c.b.a.a.a;
import java.io.File;
import java.nio.charset.Charset;
import org.json.JSONException;
import org.json.JSONObject;

/* compiled from: MetaDataStore */
public class t0 {
    public final File a;

    static {
        Charset.forName("UTF-8");
    }

    public t0(File file) {
        this.a = file;
    }

    public static y0 b(String str) throws JSONException {
        JSONObject jSONObject = new JSONObject(str);
        y0 y0Var = new y0();
        String str2 = "userId";
        String str3 = null;
        if (!jSONObject.isNull(str2)) {
            str3 = jSONObject.optString(str2, null);
        }
        if (str3 != null) {
            str3 = str3.trim();
            if (str3.length() > 1024) {
                str3 = str3.substring(0, 1024);
            }
        }
        y0Var.a = str3;
        return y0Var;
    }

    public File a(String str) {
        return new File(this.a, a.E(str, "user", ".meta"));
    }
}
